﻿using System;
using System.Globalization;
using System.Threading;

class Program
{
    static void Main()
    {
        Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;
        int[,] area = new int[18, 18];
        for (int i = 0; i < 18; i++)
        {
            area[0, i] = 0;
            area[i, 0] = 0;
            area[17, i] = 0;
            area[i, 17] = 0;
        }

        for (int row = 1; row < 17; row++)
        {
            string input = Console.ReadLine();
            char[] chars = input.ToCharArray();

            for (int col = 1; col < 17; col++)
            {
                if (chars[col - 1] == 49)
                {
                    area[row, col] = 1;
                }
                else
                {
                    area[row, col] = 0;
                }
            }
        }
        decimal cookieCounter = 0m;
        while (true)
        {
            string input = Console.ReadLine();
            if (input == "paypal")
            {
                Console.WriteLine("{0:F2}", cookieCounter * 1.79m);
                break;
            }
            else if (input == "what is")
            {
                int row = int.Parse(Console.ReadLine()) + 1;
                int col = int.Parse(Console.ReadLine()) + 1;

                if (area[row, col] == 1)
                {
                    if (area[row - 1, col] == 1 && area[row + 1, col] == 1 && area[row - 1, col - 1] == 1 && area[row - 1, col + 1] == 1 && area[row, col - 1] == 1 && area[row, col + 1] == 1 && area[row + 1, col - 1] == 1 && area[row + 1, col + 1] == 1)
                    {
                        Console.WriteLine("cookie");
                    }
                    else if (area[row - 1, col] == 0 && area[row + 1, col] == 0 && area[row - 1, col - 1] == 0 && area[row - 1, col + 1] == 0 && area[row, col - 1] == 0 && area[row, col + 1] == 0 && area[row + 1, col - 1] == 0 && area[row + 1, col + 1] == 0)
                    {
                        Console.WriteLine("cookie crumb");
                    }
                    else
                    {
                        Console.WriteLine("broken cookie");
                    }
                }
                else
                {
                    Console.WriteLine("smile");
                }
            }
            else if (input == "buy")
            {
                int row = int.Parse(Console.ReadLine()) + 1;
                int col = int.Parse(Console.ReadLine()) + 1;

                if (area[row, col] == 1)
                {
                    if (area[row - 1, col] == 1 && area[row + 1, col] == 1 && area[row - 1, col - 1] == 1 && area[row - 1, col + 1] == 1 && area[row, col - 1] == 1 && area[row, col + 1] == 1 && area[row + 1, col - 1] == 1 && area[row + 1, col + 1] == 1)
                    {
                        cookieCounter++;
                    }
                    else
                    {
                        Console.WriteLine("page");
                    }
                }
                else
                {
                    Console.WriteLine("smile");
                }
            }
        }
    }
}